import { defineConfig, mergeConfig } from 'vite'
import common from './config/common'
import dev from './config/dev'
import prod from './config/prod' 
import test from './config/test'

export default defineConfig(({ mode, command }) => {  
  console.log('vite.config.ts', mode, command);
  
  if (mode === 'development') {
    return mergeConfig(common, dev)
  }
  if (mode === 'production') {
    return mergeConfig(common, prod)
  }
  if (mode === 'test') {
    return mergeConfig(common, test)
  }
  return common
})
